home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / CIncludes / Dictionary.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-18  |  4.1 KB  |  130 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Dictionary.h
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. */
  19.  
  20. #ifndef __DICTIONARY__
  21. #define __DICTIONARY__
  22.  
  23.  
  24. #ifndef __TYPES__
  25. #include <Types.h>
  26. #endif
  27. /*    #include <ConditionalMacros.h>                                */
  28.  
  29. #ifndef __FILES__
  30. #include <Files.h>
  31. #endif
  32. /*    #include <MixedMode.h>                                        */
  33. /*    #include <OSUtils.h>                                        */
  34. /*        #include <Memory.h>                                        */
  35.  
  36. #ifdef __cplusplus
  37. extern "C" {
  38. #endif
  39.  
  40. #if PRAGMA_ALIGN_SUPPORTED
  41. #pragma options align=mac68k
  42. #endif
  43.  
  44. #if PRAGMA_IMPORT_SUPPORTED
  45. #pragma import on
  46. #endif
  47.  
  48.  
  49. enum {
  50. /* Dictionary data insertion modes */
  51.     kInsert                        = 0,                            /* Only insert the input entry if there is nothing in the dictionary that matches the key. */
  52.     kReplace                    = 1,                            /* Only replace the entries which match the key with the input entry. */
  53.     kInsertOrReplace            = 2                                /* Insert the entry if there is nothing in the dictionary which matches the key. 
  54.                            If there is already matched entries, replace the existing matched entries with the input entry. */
  55. };
  56.  
  57. /* This Was InsertMode */
  58. typedef short DictionaryDataInsertMode;
  59.  
  60.  
  61. enum {
  62. /* Key attribute constants */
  63.     kIsCaseSensitive            = 0x10,                            /* case sensitive = 16        */
  64.     kIsNotDiacriticalSensitive    = 0x20                            /* diac not sensitive = 32    */
  65. };
  66.  
  67. enum {
  68. /* Registered attribute type constants.    */
  69.     kNoun                        = -1,
  70.     kVerb                        = -2,
  71.     kAdjective                    = -3,
  72.     kAdverb                        = -4
  73. };
  74.  
  75. /* This Was AttributeType */
  76. typedef SInt8 DictionaryEntryAttribute;
  77.  
  78. /* Dictionary information record */
  79. struct DictionaryInformation {
  80.     FSSpec                            dictionaryFSSpec;
  81.     SInt32                            numberOfRecords;
  82.     SInt32                            currentGarbageSize;
  83.     ScriptCode                        script;
  84.     SInt16                            maximumKeyLength;
  85.     SInt8                            keyAttributes;
  86.     SInt8                            filler;
  87. };
  88. typedef struct DictionaryInformation DictionaryInformation;
  89.  
  90. struct DictionaryAttributeTable {
  91.     UInt8                            datSize;
  92.     DictionaryEntryAttribute        datTable[1];
  93. };
  94. typedef struct DictionaryAttributeTable DictionaryAttributeTable;
  95.  
  96. typedef DictionaryAttributeTable *DictionaryAttributeTablePtr;
  97.  
  98. extern pascal OSErr InitializeDictionary(const FSSpec *theFsspecPtr, SInt16 maximumKeyLength, SInt8 keyAttributes, ScriptCode script)
  99.  THREEWORDINLINE(0x303C, 0x0500, 0xAA53);
  100. extern pascal OSErr OpenDictionary(const FSSpec *theFsspecPtr, SInt8 accessPermission, SInt32 *dictionaryReference)
  101.  THREEWORDINLINE(0x303C, 0x0501, 0xAA53);
  102. extern pascal OSErr CloseDictionary(SInt32 dictionaryReference)
  103.  THREEWORDINLINE(0x303C, 0x0202, 0xAA53);
  104. extern pascal OSErr InsertRecordToDictionary(SInt32 dictionaryReference, ConstStr255Param key, Handle recordDataHandle, DictionaryDataInsertMode whichMode)
  105.  THREEWORDINLINE(0x303C, 0x0703, 0xAA53);
  106. extern pascal OSErr DeleteRecordFromDictionary(SInt32 dictionaryReference, ConstStr255Param key)
  107.  THREEWORDINLINE(0x303C, 0x0404, 0xAA53);
  108. extern pascal OSErr FindRecordInDictionary(SInt32 dictionaryReference, ConstStr255Param key, DictionaryAttributeTablePtr requestedAttributeTablePointer, Handle recordDataHandle)
  109.  THREEWORDINLINE(0x303C, 0x0805, 0xAA53);
  110. extern pascal OSErr FindRecordByIndexInDictionary(SInt32 dictionaryReference, SInt32 recordIndex, DictionaryAttributeTablePtr requestedAttributeTablePointer, Str255 recordKey, Handle recordDataHandle)
  111.  THREEWORDINLINE(0x303C, 0x0A06, 0xAA53);
  112. extern pascal OSErr GetDictionaryInformation(SInt32 dictionaryReference, DictionaryInformation *theDictionaryInformation)
  113.  THREEWORDINLINE(0x303C, 0x0407, 0xAA53);
  114. extern pascal OSErr CompactDictionary(SInt32 dictionaryReference)
  115.  THREEWORDINLINE(0x303C, 0x0208, 0xAA53);
  116.  
  117. #if PRAGMA_IMPORT_SUPPORTED
  118. #pragma import off
  119. #endif
  120.  
  121. #if PRAGMA_ALIGN_SUPPORTED
  122. #pragma options align=reset
  123. #endif
  124.  
  125. #ifdef __cplusplus
  126. }
  127. #endif
  128.  
  129. #endif /* __DICTIONARY__ */
  130.